Merged
Conversation
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
86087f4 to
8ddac2e
Compare
tuna1207
previously approved these changes
Feb 5, 2026
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
tuna1207
reviewed
Feb 6, 2026
tuna1207
previously approved these changes
Feb 9, 2026
tuna1207
approved these changes
Feb 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Current errors from SubscriptionService lack enough context for Sentry, making it hard to diagnose failures. This change enriches SubscriptionServiceError with additional error details (e.g., HTTP status and response info) and improves error handling paths so those details are preserved and surfaced.
BREAKING: This PR also adds two new params,
captureExceptionandfetchFunctiontoSubscriptionServiceconstructor args.fetchFunctionis to use the client providedFetchAPI.captureExceptionis to capture the error thrown and report to Sentry. This is to isolate the Subscription APIs errors reported to Sentry.References
Related to MetaMask/metamask-extension#39432. This won't fix the underlying issue (which is still TBD) but it adds more helpful info for the debugging.
Checklist
Note
Medium Risk
Touches all Subscription Service network calls and error propagation, and introduces a breaking constructor change that all consumers must update; failures could change runtime error behavior if integrations don’t pass compatible
fetch/Sentry handlers.Overview
BREAKING:
SubscriptionServicenow requires afetchFunctionand optionally acceptscaptureException, replacing the internalhandleFetchusage.Request handling is refactored to validate URL construction, parse non-2xx HTTP responses into structured error messages (status/body/errorCode), attach underlying causes to
SubscriptionServiceError, and include request URLs for better Sentry diagnostics; a small logger wrapper is added.Adds
SubscriptionServiceErrorMessageconstants plusSubscriptionApiErrortype exports, and expands/adds tests to cover network vs non-ok responses, non-Errorthrows, auth token failures, URL construction failures, and controller surfacing oftriggerAccessTokenRefresherrors.Written by Cursor Bugbot for commit f06b61b. This will update automatically on new commits. Configure here.